package com.whty.cms.filewps.test;
/** 版本控制测试类
 * @Author zgh
 * @create 2019/3/19 16:11
 */
import com.whty.cms.filewps.common.version.ApiVersion;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/{version}/")
public class HelloController {

    @RequestMapping("/hello")
    @ApiVersion(1)
    @ResponseBody
    public String hello(HttpServletRequest request){
        return "hello..V1..kitty......";
    }

    @RequestMapping("/hello")
    @ApiVersion(2)
    @ResponseBody
    public String helloV2(HttpServletRequest request){
        System.out.println("hello....baby.....");

        return "hello..V2..baby.....";
    }

    @RequestMapping("/hello")
    @ApiVersion(5)
    @ResponseBody
    public String helloV5(HttpServletRequest request){
        System.out.println("hello.....V5....");

        return "hello.....V5....";
    }

}